Conversation
WalkthroughThis PR fixes a bug where closing an issue after editing its title creates a new open-issue file instead of properly managing the original. The core change modifies Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.issues/closed/014-create-new-issue-when-close.md (1)
18-26: Consider adding language specification to the fenced code block.The fenced code block showing the console output would benefit from a language specification for better rendering and syntax highlighting.
Apply this diff:
-``` +```bash gi close 004 -c ✓ Closed issue #004 [feat/balance-check 9901acb] Close issue #004cmd/close_test.go (1)
182-223: Duplicate test coverage detected.The new test
TestRunCloseAfterEditDoesNotCreateNewIssueFileappears to duplicate functionality already covered byTestRunClosePreservesFilenameWhenTitleModified(lines 225-286). Both tests:
- Create an issue with "Original Title"
- Edit the title to change the slug
- Close the issue
- Verify the filename contains "original-title"
- Verify no duplicate files were created
The primary difference is that the new test uses
pkg.SaveIssueto edit (line 197), while the existing test usesos.WriteFiledirectly (line 250). Consider consolidating these tests or clearly differentiating what unique behavior each one validates.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.issues/.counter(1 hunks).issues/closed/014-create-new-issue-when-close.md(1 hunks)cmd/close_test.go(1 hunks)pkg/storage.go(1 hunks)pkg/storage_test.go(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
pkg/storage_test.go (1)
pkg/storage.go (5)
InitializeRepo(22-95)NewIssue(330-341)SaveIssue(122-150)OpenDir(14-14)IssuesDir(13-13)
pkg/storage.go (1)
pkg/parser.go (1)
GenerateSlug(80-105)
cmd/close_test.go (1)
pkg/storage.go (6)
LoadIssue(153-173)SaveIssue(122-150)ListIssues(223-254)OpenDir(14-14)FindIssueFile(258-272)ClosedDir(15-15)
🪛 markdownlint-cli2 (0.18.1)
.issues/closed/014-create-new-issue-when-close.md
18-18: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (3)
.issues/.counter (1)
1-1: LGTM!Counter increment is correct for the new issue being added.
pkg/storage_test.go (2)
6-6: LGTM!The
stringsimport is necessary for the filename validation logic in the new test.
166-208: LGTM!The test effectively verifies that
SaveIssuepreserves the original filename slug when an issue is saved after editing its title. The test logic is clear and comprehensive, checking both that only one file exists and that it contains the original slug.
close 014
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.